package light.head.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.Formula;

@Entity
@Table
public class Transfer implements Serializable {
	
	private static final long serialVersionUID = 1L;
	
	
	private Integer code;					// 流水号
	private String text;					// 内容
	private Integer tName;					// 移交人
	private Integer rName;					// 接收人
	private Integer orname;					// 原办理人
	private Boolean deleted = false;		// 是否删除
	private Integer mc;						// 任务编号
	private String title;					// 标题
	private Date ct;						// 移交时间（创建时间）
	private Integer oc;						// 所属机构
	
	
	
	private String mcn;						// 任务名称
	private String tn;						// 移交人姓名
	private String rn;						// 接收人姓名
	private String orn;						// 原办理人姓名
	 
	
	
	
	
	
	
	
	
	
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column
	public Integer getCode() {
		return code;
	}
	@Column(length = 1000)
	public String getText() {
		return text;
	}
	@Column
	public Integer gettName() {
		return tName;
	}
	@Column
	public Integer getrName() {
		return rName;
	}
	@Column
	public Boolean getDeleted() {
		return deleted;
	}
	@Column
	public Integer getMc() {
		return mc;
	}
	@Column
	public String getTitle() {
		return title;
	}
	@Column
	public Date getCt() {
		return ct;
	}
	@Column
	public Integer getOrname() {
		return orname;
	}
	@Formula("(SELECT u.realName FROM UserInfo u WHERE u.code = orname)")
	public String getOrn() {
		return orn;
	}
	@Formula("(SELECT t.title FROM Task t WHERE t.code = mc)")
	public String getMcn() {
		return mcn;
	}
	@Formula("(SELECT u.realName FROM UserInfo u WHERE u.code = tName)")
	public String getTn() {
		return tn;
	}
	@Formula("(SELECT u.realName FROM UserInfo u WHERE u.code = rName)")
	public String getRn() {
		return rn;
	}
	@Column
	public Integer getOc() {
		return oc;
	}
	
	
	
	
	
	
	
	
	
	
	
	
	
	public void setOc(Integer oc) {
		this.oc = oc;
	}
	public void setOrname(Integer orname) {
		this.orname = orname;
	}
	public void setOrn(String orn) {
		this.orn = orn;
	}
	public void setTn(String tn) {
		this.tn = tn;
	}
	public void setRn(String rn) {
		this.rn = rn;
	}
	public void setMcn(String mcn) {
		this.mcn = mcn;
	}
	public void setCt(Date ct) {
		this.ct = ct;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public void setCode(Integer code) {
		this.code = code;
	}
	public void setText(String text) {
		this.text = text;
	}
	public void settName(Integer tName) {
		this.tName = tName;
	}
	public void setrName(Integer rName) {
		this.rName = rName;
	}
	public void setDeleted(Boolean deleted) {
		this.deleted = deleted;
	}
	public void setMc(Integer mc) {
		this.mc = mc;
	}
	
	
	
}
